package com.sunqianhu.design_patterns_23.behavioral.mediator;

public class Client {
    public static void main(String[] args) {
        ChatRoomMediator chatRoom = new ChatRoomMediator();

        User user1 = new User(chatRoom, "Alice");
        User user2 = new User(chatRoom, "Bob");
        User user3 = new User(chatRoom, "Charlie");

        chatRoom.addColleague(user1);
        chatRoom.addColleague(user2);
        chatRoom.addColleague(user3);

        user1.send("大家好！");
        user2.send("你好，Alice！");
    }
}
